package com.prd.controller;


import com.prd.dto.OaPersonnelRequirementDTO;
import com.prd.service.OaPersonnelRequirementService;
import com.prd.util.JsonData;
import com.prd.vo.OaPersonRequireVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 人员需求管理数据表 前端控制器
 * </p>
 *
 * @author lizhaoyi
 * @since 2024-01-26
 */
@RestController
@RequestMapping("/api/oaPersonnelRequirement")
@Api(tags = "人员需求管理")
public class OaPersonnelRequirementController {


    @Autowired
    private OaPersonnelRequirementService requirementService;


    @ApiOperation("人员需求分页列表")
    @GetMapping("page")
    public JsonData getPageList(@RequestBody OaPersonRequireVo vo){

        return requirementService.getPageList(vo);
    }

    @ApiOperation("发布需求")
    @PostMapping("release")
    public JsonData releaseRequire(@RequestBody OaPersonnelRequirementDTO requirementDTO){

        return requirementService.releaseRequire(requirementDTO);
    }

    @ApiOperation("取消发布")
    @PostMapping("cancel/{id}")
    public JsonData cancelRelease(@PathVariable("id") Long id){

        return requirementService.cancelRelease(id);
    }

    @ApiOperation("人员需求详情")
    @GetMapping("detail/{id}")
    public JsonData requireDetail(@PathVariable("id") Long id){

        return requirementService.requireDetail(id);
    }

}

